package com.yaj.mesif.service.impl;

import cn.hutool.core.date.DateUtil;
import cn.hutool.http.HttpRequest;
import cn.hutool.json.JSONObject;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.yaj.mesif.dto.ToCanOrderDto;
import com.yaj.mesif.entity.ToCanOrder;
import com.yaj.mesif.mapper.ToCanOrderMapper;
import com.yaj.mesif.service.ToCanOrderService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.Comparator;
import java.util.List;

/**
 * <p>
 *  服务实现类
 * </p>
 *
 * @author wei
 * @since 2021-08-24
 */
@Slf4j
@Service
public class ToCanOrderServiceImpl extends ServiceImpl<ToCanOrderMapper, ToCanOrder> implements ToCanOrderService {
    @Resource
    private ToCanOrderMapper toCanOrderMapper;

    @Override
    public List<ToCanOrder> GetCanOrderList() {
        List<ToCanOrder> toCanOrders = toCanOrderMapper.selectList(new QueryWrapper<ToCanOrder>().lambda().eq(ToCanOrder::getProcessflag, "0").orderByAsc(ToCanOrder::getSeqNo));

        return toCanOrders;
    }

    @Override
    public int ifo1004UpdateToOrder(ToCanOrder toCanOrder) {
        return toCanOrderMapper.ifo1004UpdateToOrder(toCanOrder);
    }
}
